package com.learn.my.http.result;

import lombok.Data;

@Data
public class ResultVo<T> {
    T data;
    String msg;
    int state;

    public ResultVo(T data, String msg, int state) {
        this.data = data;
        this.msg = msg;
        this.state = state;
    }



    public static <T> ResultVo<T> createData(T data){
        return new ResultVo<>(data,"",200);
    }

    public static <T> ResultVo<T> createError(int state,String msg){
        return new ResultVo<>(null,msg,state);
    }

}
